<?php
namespace app\admin\controller;

class Index extends ControllerBase
{
    /**
     * @OA\Post(
     *   tags={"首页"},
     *   path="/index/index",
     *   summary="首页接口",
     *   @OA\Parameter(name="userId", in="query", @OA\Schema(type="string"), required=true, description="用户ID"),
     *   @OA\Response(
     *     @OA\MediaType( mediaType="application/json"),
     *     response=200,
     *     description="返回一段thinkphp6.0的广告"
     *   )
     * )
     */
    public function index()
    {
        return result()->data(getCurrentEnv())->toJson();
        //这是自定义返回code的，默认是0        return result()->data(['title'=>'这是测试的主页接口'])->code(CodeBase::$Fail)->toJson();
    }
}
